//选中全选按钮，下面的checkbox全部选中 
function selectAll(){
	
	var status = document.getElementById("checkAll").checked;
	var childs = document.getElementsByName("child");
	var count = childs.length;
	for(var i=0;i<count;i++){
		childs[i].checked = status;
	}

}

//当选中所有的时候，全选按钮会勾上 
function chickchild(){
	var childs = document.getElementsByName("child");
	var count = childs.length;
	var checkcount =0;
	for(var i=0;i<count;i++){
		if(childs[i].checked==true){
			checkcount++;
		}
	}
	if(count==checkcount){
		document.getElementById("checkAll").checked=true;
		document.getElementById("recheck").checked = false;
	}else{
		document.getElementById("checkAll").checked=false;
	}
	
}

//反选按钮 
function notSelectAll() {
	var childs = document.getElementsByName("child");
	var count = childs.length;
	for(var i=0;i<count;i++){
		childs[i].checked = !childs[i].checked;
		chickchild();
	}
}

function deleteall(url){
	var childs = document.getElementsByName("child");
	var count = childs.length;
	var ids = new Array();
	for(var i=0;i<count;i++){
		if(childs[i].checked==true){
			var id = childs[i].value;
			ids.push(id);
		}
	}
	
	if(ids.length>0){
		if(confirm("确认删除？")){
			
			location.href=url + ids;
		}
	}else{
		alert("请选择要删除的用户数据");
	}
}